package com.learn.dubbo.core.controller;

import java.util.HashMap;
import java.util.Map;

import com.learn.dubbo.core.systemenum.TypeEnum;
import com.learn.dubbo.core.util.JsonUtil;

public class BaseController {
	
	public <T> T getParameter(String key,String param,TypeEnum type){
		Map<String,Object> map = JsonUtil.readValue(param, HashMap.class);
		if(TypeEnum.Long.equals(type)){
			return (T)Long.valueOf(map.get(key).toString());
		}
		return null;
	}

}
